package com.bobamrz.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.bobamrz.dao.UserDAO;
import com.bobamrz.domain.UserDTO;

public class AuthentificationService {

	public boolean authentificate(String username, String password, HttpSession session) {
		UserDAO userDAO = new UserDAO();
		UserDTO user = userDAO.authFunction(password, username);
		if (user != null) {
			session.setAttribute("user", user);
			return true;
		} else {
			return false;
		}
	}
	
}
